package com.mt.mtbusinessmanagementsystem.utils.product.level;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.*;
import org.springframework.stereotype.Repository;

import java.util.Date;

@Builder
@Repository
@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonInclude(JsonInclude.Include.NON_EMPTY)
public class FatherLevel {
    private Integer id;
    private String name;
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date date;

    public FirstLevel fromFirstLevel(){
        return FirstLevel.builder().firstClassificationId(id).firstClassificationName(name).build();
    }
    public SecondLevel fromSecondLevel(){
        return SecondLevel.builder().secondClassificationId(id).secondClassificationName(name).build();
    }
    public ThirdLevel fromThirdLevel(){
        return ThirdLevel.builder().thirdClassificationId(id).thirdClassificationName(name).build();
    }
    public FourthLevel fromFourthLevel(){
        return FourthLevel.builder().fourthClassificationId(id).fourthClassificationName(name).date(date).build();
    }
}
